Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rpldy/simple-state

Package Overview
Dependencies
Maintainers
0
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpldy/simple-state

deep proxy object, so it's only updateable through an update method

  • 1.8.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
decreased by-19.97%
Maintainers
0
Weekly downloads
 
Created
Source
npm version Build Status codecov status bundlephobia badge rpldy storybook

Simple State

Internal package

Deep proxies an object so it is only updateable through an update callback. outside an updater, it is impossible to make changes

It only proxies simple objects (not maps or sets) and arrays

It doesnt create new references and doesnt copy over anything

Original object is changed!

The best place to get started is at our: React-Uploady Documentation Website

Installation

#Yarn: 
   $ yarn add @rpldy/simple-state 

#NPM:
   $ npm i @rpldy/simple-state

Important!

All exports of this package are considered internal API and may change/disappear in any version: patch/minor/major

Example

import createState from "@rpldy/simple-state"

const { state, update } = createState({
    arr: [1,2,3]
});

state.arr.push(4);
console.log(state.arr); // print [1,2,3]

update((state) => {
    state.arr.push(4);
});

console.log(state.arr); // print [1,2,3,4]

FAQs

Package last updated on 19 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc